using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
	[Table("bgm_mas_option"), DataContract]
    public class MasOption
    {
        public MasOption()
        {
            //this.ProjectOptions = new HashSet<ProjectOption>();
            //this.RequestOptions = new HashSet<RequestOption>();
        }

		[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
		[DataMember, Display(Name = "BgmOptionId", ResourceType = typeof(Resources.MasOptionResource))]
		[Column("bgm_option_seq", TypeName="int")]
        public int OptionId { get; set; }

		[DataMember, Display(Name = "BgmOptionCode", ResourceType = typeof(Resources.MasOptionResource))]
        [Column("bgm_option_code", TypeName="ntext")]
        public string Code { get; set; }

		[DataMember, Display(Name = "BgmOptionName", ResourceType = typeof(Resources.MasOptionResource))]
        [Column("bgm_option_name", TypeName="ntext")]
        public string Name { get; set; }

		[DataMember, Display(Name = "BgmOptionDescr", ResourceType = typeof(Resources.MasOptionResource))]
        [Column("bgm_option_descr", TypeName="ntext")]
        public string Descr { get; set; }

		[ForeignKey("UpperBgmOption")]
		[DataMember, Display(Name = "UpperBgmOptionId", ResourceType = typeof(Resources.MasOptionResource))]
        [Column("upper_bgm_option_seq", TypeName="int")]
        public Nullable<int> UpperOptionId { get; set; }

		[ForeignKey("JobSite")]
		[DataMember, Display(Name = "JobSiteId", ResourceType = typeof(Resources.MasOptionResource))]
		[Column("job_site_seq", TypeName="int")]
        public Nullable<int> JobSiteId { get; set; }

        [ForeignKey("SystemOptionType")]
		[DataMember, Display(Name = "BgmOptionTypeId", ResourceType = typeof(Resources.MasOptionResource))]
		[Column("bgm_option_type_seq", TypeName="int")]
        public Nullable<int> OptionTypeId { get; set; }

		[DataMember, Display(Name = "BgmYear", ResourceType = typeof(Resources.MasOptionResource))]
		[Column("bgm_year", TypeName="int")]
        public Nullable<int> BgYear { get; set; }

        //[DataMember]
        //public virtual ICollection<ProjectOption> ProjectOptions { get; set; }

        //[DataMember]
        //public virtual ICollection<RequestOption> RequestOptions { get; set; }

        [DataMember]
		public virtual MasOption UpperBgmOption { get; set; }

        [DataMember]
		public virtual HRM.JobSite JobSite { get; set; }

        [DataMember]
        public virtual SystemOptionType SystemOptionType { get; set; } //



        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
		[Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}